import sqlite3
'''
conn = sqlite3.connect("test.db")
c = conn.cursor()
sql = 
    create table company (
       id int primary key not null,
       name varchar(20) not null,
       age int not null,
       address char(20),
       salary varchar(20)
     );

c.execute(sql)
conn.commit()
conn.close()
print("成功建表")
'''

conn = sqlite3.connect("../2 爬取实例（豆瓣电影top250）/test.db")
c = conn.cursor()
# sql = '''
#     insert into company values(1, "张三", 20, "北京", "23020"),
#     (2, "李四", 23, "云南", "23451")
# '''
sql = 'select * from company'
cursor = c.execute(sql)

for row in cursor:
    print(row)
conn.close()









